package com.openweixin.sheknows.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 实体类-专家回复
 * 
 * @注意事项 无
 * @author 刘思作
 * @version 1.0.0 2014-04-02
 * @since 1.0.0
 */

@Entity
@Table(name = "answer")
public class Answer implements Serializable{
	

	private static final long serialVersionUID = 2474870038600997883L;
	private Integer aid;//
	private Question question;
	private String author;// 回答人名称
	private String content;//
	private String useip;//
	private Integer score;// 评分
	private Integer scoreuid;// 评分人
	private String scoreauthor;// 评价人名称
	private java.sql.Timestamp datetime;//
	private User expert;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getAid() {
		return this.aid;
	}

	public void setAid(Integer aid) {
		this.aid = aid;
	}
	

	@ManyToOne
	@JoinColumn(name="qid")
	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="uid")
	public User getExpert() {
		return expert;
	}

	public void setExpert(User expert) {
		this.expert = expert;
	}


	@Column(name = "author")
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "useip")
	public String getUseip() {
		return this.useip;
	}

	public void setUseip(String useip) {
		this.useip = useip;
	}

	@Column(name = "score")
	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	@Column(name = "scoreuid")
	public Integer getScoreuid() {
		return this.scoreuid;
	}

	public void setScoreuid(Integer scoreuid) {
		this.scoreuid = scoreuid;
	}

	@Column(name = "scoreauthor")
	public String getScoreauthor() {
		return this.scoreauthor;
	}

	public void setScoreauthor(String scoreauthor) {
		this.scoreauthor = scoreauthor;
	}

	@Column(name = "datetime")
	public java.sql.Timestamp getDatetime() {
		return this.datetime;
	}

	public void setDatetime(java.sql.Timestamp datetime) {
		this.datetime = datetime;
	}

	
	private boolean newScore;

	@Transient
	public boolean isNewScore() {
		return newScore;
	}

	public void setNewScore(boolean newScore) {
		this.newScore = newScore;
	}
	
}